Move your mouse pointer over the diagram. Does your browser ignore this event?
Maybe. Some browsers ignore this mouseOver
event.
Other browsers change the mouse pointer
to show that there is a new set of options on a right-click.
Most browsers show a tool tip for the image.
Move your mouse pointer over one of the buttons. Does your browser ignore this event?
Usually not. Most browsers change the mouse
pointer from an arrow to a hand button for
a mouseOver
event on a button.
Of course, when you click the button that is another kind of event, and is not ignored.
A GUI program has three parts:
The graphical components are Swing objects. You usually extend them to make them fit your application.
Listener methods are Java methods that you write. Listener methods respond to events by calling application methods.
Application methods are ordinary Java methods that perform useful computations. They receive data from the GUI and send data to the GUI to be displayed, but are not usually themselves concerned with the user interface.
Your Web browser has components (such as the "back" and "forward" buttons), listener methods that receive events (such as a click on the "back" button) and application methods that do useful things (such as moving backward or forward one page).
To write a GUI application, keep these three types of software separated (while keeping the big picture in mind). In a big software project an entire team of programmers is assigned to each of the tasks.
Consider a radio and its user interface. Match each part of the radio with its analogous part in a GUI application.